<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Project_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-publicwelfare_id" class="form-control selectpicker" name="row[publicwelfare_id]" data-rule="required" >
                <option value="">{:__('Please Select')}</option>
                {foreach name="projects" item="vo"}
                <option value="{$vo.publicwelfare_id}" {if (count($projects) == 1) || ($vo.project_name == $row.project_name)}selected{/if}>{$vo.project_name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Course_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-course_name" class="form-control" name="row[course_name]" type="text" value="{$row.course_name|htmlentities}" data-rule="required">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">主讲单位:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-teaching_unit" class="form-control" name="row[teaching_unit]" type="text" value="{$row.teaching_unit}" placeholder="请输入主讲单位">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">课程图片:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-course_image" class="form-control" name="row[course_image]" type="text" value="{$row.course_image}" placeholder="请选择或上传课程图片">
                <div class="input-group-btn">
                    <button type="button" id="plupload-course-image" class="btn btn-danger plupload" data-input-id="c-course_image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-course-image"><i class="fa fa-upload"></i> {:__('Upload')}</button>
                    <button type="button" class="btn btn-success ai-generate-image" data-type="ai-generate-course_image" data-input-id="c-course_image" data-width="1024" data-height="1024" data-say="为这个课程生成一张有创意的封面图片，风格现代简洁，色彩温暖" title="AI生成图片"><i class="fa fa-magic"></i> AI生成</button>
                </div>
            </div>
            <span class="msg-box n-right" for="c-course_image"></span>
            <div class="form-inline">
                <img id="p-course-image" class="img-responsive img-thumbnail plupload-preview" src="{$row.course_image}" style="max-height:150px;display:{if $row.course_image}block{else/}none{/if};" />
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">课程介绍:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <textarea id="c-course_description" class="form-control" name="row[course_description]" rows="4" placeholder="请输入课程介绍">{$row.course_description}</textarea>
                <div class="input-group-btn" style="vertical-align: top;">
                    <button type="button" class="btn btn-success" data-ai-generate-text data-target-id="c-course_description" data-prompt-template="为课程'{name}'生成简单的课程介绍以普通话形式输出，最多不超过200字。" data-max-length="1000" data-say="" data-size="1024x1024" data-preview-id="p-course-description" title="AI生成介绍"><i class="fa fa-magic"></i> AI生成</button>
                </div>
            </div>
            <span class="msg-box n-right" for="c-course_description"></span>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
